package com.itheima.spring.aop;

import com.itheima.spring.aop.advisor.Advisor;
import com.itheima.spring.beans.BeanFactory;

import java.util.List;

/**
 *  工厂AopProxyFactory负责选择使用哪个动态代理
 */
public interface AopProxyFactory {

    AopProxy createAopProxy(Object bean, String beanName, List<Advisor> matchAdvisors, BeanFactory beanFactory) throws Throwable;

    /**
     * 获得默认的AopProxyFactory实例
     */
    static AopProxyFactory getDefaultAopProxyFactory(){
        return new DefaultAopProxyFactory();
    }
}
